﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestByWire.Test
{
	[TestClass]
	public class TargetInitializedArgsTest
	{
		[TestMethod]
		public void Constructor_MustSetPropertyToProvidedInstance_WhenProvided()
		{
			var instance = new Object();

			var eventArgs = new TargetInitializedArgs<Object>(instance);

			Assert.AreSame(instance, eventArgs.TargetInstance);
		}

		[TestMethod]
		public void Constructor_MustThrow_WhenTargetInstanceIsNull()
		{
			var exception = AssertEx.Throws<ArgumentNullException>(()=> new TargetInitializedArgs<Object>(null));

			Assert.AreEqual("targetInstance", exception.ParamName);
		}
	}
}
